User-defined Error Codes

Description

Alpha Anywhere has had a CallResult object since A5 Version 8. As of Version 11, we have reserved the error code range from 20000 to 24999 for User-defined Error Codes. You may define your own error codes by editing Alpha5.errors. We recommend keeping a backup of your additions so that you can easily merge them into any future versions of Alpha5.errors that we release.

Example

Alpha5.errors:

...
20000=User Error Code Start
20001=Frizzbot Unable to reach protected resource. Please check corporate VPN status.
24999=User Error Code End
...
FUNCTION Frizzbot as CallResult (...)
Dim Result as CallResult
...
If  ResFound
    Result.ReturnDataValue = FoundItem
else
    Result.Code = 20001 ' Unable to reach protected resource
end if
 
Frizzbot = Result
END FUNCTION

The script that calls Frizzbot() should check the returned CallResult immediately and proceed according to the returned values. The error string in Alpha5.errors will automatically populate Result.Text.